<template>
	<view class="container">
		<view class="content-wrap">
			<view @click="jumpDetail(item)" class="item-box" v-for="(item,index) in listData" :key="item.id">
				<image class="img-avatar" :src="item.group_cover" mode=""></image>
				<view class="info">
					<view class="name">
						<view class="name-text text-ellipsis-1"> {{item.group_id_name}}</view>
						<!-- <view class="tag" v-if="item.is_del == 0">已删除</view> -->
					</view>
					<view class="tips">
						{{$Common.timeAgo(item.created_time)}} | {{item.nick_name}}
					</view>
				</view>
			</view>
			<cu-empty tips="这里什么也没有~" v-if="listData && listData.length == 0"></cu-empty>
			<u-loadmore v-else :status="refreshStatus" />
		</view>
	</view>
</template>

<script>
	import Refresh from '@/mixins/refresh'
	export default {
		mixins: [Refresh],
		components: {},
		data() {
			return {
				modalShow: false,
				listData: null
			}
		},
		onLoad() {

		},
		onShow() {
			this.getList(false);
		},
		methods: {
			// 圈子详情
			jumpDetail(item) {
				this.$Jump.Open('/pages/mine/circle/circleDetail?id=' + item.group_id)
			},
			// 加载圈子列表
			getList(status) {
				this.$Net.get(this.$api.user_group_list, this.searchReq).then(res => {
					this.setStatus(res.count, res.list, status);
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding-top: 32rpx;

		.content-wrap {
			padding-bottom: 40rpx;
			padding-bottom: calc(40rpx + constant(safe-area-inset-top));
			padding-bottom: calc(40rpx + env(safe-area-inset-top));
		}

		.item-box {
			margin-bottom: 50rpx;
			border-radius: 16px;
			display: flex;
			align-items: center;

			.img-avatar {
				width: 72rpx;
				height: 72rpx;
				margin-right: 28rpx;
				border-radius: 32rpx;
			}

			.info {
				.name {

					display: flex;
					align-items: center;

					.name-text {
						color: #000;
						font-family: "PingFang SC";
						font-size: 36rpx;
						font-weight: 400;
						margin-right: 28rpx;
						max-width: 400rpx;
					}

					.tag {
						padding: 2px 6px;
						display: inline-block;
						border-radius: 33px;
						background: #E7EAED;
						color: rgba(0, 0, 0, 0.80);
						text-align: center;
						/* 五级文字/常规 */
						font-family: "PingFang SC";
						font-size: 12px;
						font-weight: 400;
					}
				}

				.tips {
					color: rgba(0, 0, 0, 0.60);
					font-family: "PingFang SC";
					font-size: 28rpx;
					font-weight: 400;
					margin-top: 12rpx;
				}
			}
		}
	}
</style>